package se.jagvetintedu;

import java.util.ArrayList;

//
// The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
// Find the sum of all the primes below two million.
//
public class Problem10 {
	
	
	private Long sum() {
		Long sum = 0L;
		prime myPrimeGen = new prime();
		ArrayList<Integer> primes = myPrimeGen.generate(2000000);
		
		for (Integer i : primes) {
			sum += i;
		}
		return sum;
	}
	public static void main(String args[])
	{
		System.out.println("Project Euler, problem 10");
		
		Problem10 solution = new Problem10();

		System.out.println("The sum of all primes below two milion: " + solution.sum());
	}
}
